let base = "https://tg2.quzz.fun/v1";
// #ifdef H5
if (/localhost/.test(location.host)) {
  base = "http://localhost:6011/v1";
}
// #endif

export const baseURL = base;

export const apiPre = {
  // t2: "https://t2.hqs.link/app/22",
  cos: "https://hqs.link",
};

let socket = "wss://ice.qs3.fun";
// #ifdef H5
// socket = "ws://localhost:6012";
// #endif

uni.$apiHub = {
  socket,

  uploadFile: baseURL + "/fun/auth/upload", // 需完整路径
  searchPlace: "/fun/auth/map/search-place",

  mpLogin: "/user/mp-login",
  getVcode: "/user/vcode",
  checkVcode: "/user/check-vcode",
  userInfo: "/user/auth/user-info",

  checkRowUpdate: baseURL + "/link/check-row-update",
  compareFace: "/adm/auth/compare-face",

  domiGoods: "/domilafa/goods",

  shopHome: "/shop/home",
  shopList: "/shop/shop-list",
  shopInfo: "/shop/shop-info",
  bannerList: "/shop/banner-list",
  goodsList: "/shop/goods-list",
  goodsInfo: "/shop/goods-info",

  postOrder: "/trade/auth/prepay",

  ordList: "/order/auth/order-list",
  ordInfo: "/order/auth/order-info",
  ordRefund: "/order/auth/refund",
  ordUse: "/order/auth/order-use",
  ordFeePay: "/order/auth/fee-prepay",

  dataApi: (type, tab) => {
    return `/data/${type}/${tab}`;
  },
};
